var status = -1;
var selectionLog = [];

function start() {
    action(1, 0, 0)
}

function action(f, g, j) {
    if (status == 0 && f == 0) {
        cm.dispose();
        return
    }(f == 1) ? status++ : status--;
    selectionLog[status] = j;
    var e = -1;
    if (status <= e++) {
        cm.dispose()
    } else {
        if (status === e++) {
            if (!cm.isQuestActive(37711)) {
                cm.playerMessage(-1, "一朵奇怪的花。");
                cm.dispose();
                return
            } else {
                var h = cm.getPlayer().getPosition();
                var d = Math.abs(h.x + 355) < 110;
                var c = Math.abs(h.x - 1211) < 110;
                var b = Math.abs(h.x - 1198) < 110;
                var a = Math.abs(h.x - 598) < 110;
                var k = Math.abs(h.x - 90) < 110;
                if (d || c || b || a || k) {
                    cm.addNumberForQuestInfo(37711, "flower", 1);
                    cm.addPopupSay(0, 2000, "#face0#已经调查了#r" + cm.getNumberFromQuestInfo(37711, "flower") + "朵#k花。再去调查一下其他花吧。", "", 0)
                } else {
                    cm.playerMessage(-1, "再靠近一点，对花进行调查吧。");
                    cm.playerMessage(5, "再靠近一点，对花进行调查吧。");
                    cm.dispose();
                    return
                }
            }
            cm.dispose()
        }
    }
};